init_arbre := proc (A)
	# A DOIT ETRE UNE LISTE
	local B, n, k, i, j, l;
	n := nops(A);
	k := log[2](n);
	for i from 0 to k do
		for j from 0 to 2^(k-i)-1 do
			#for l from (2^i)*j to (2^i)*(j+1)-1 do
				#B[i][j] = B[i][j]*(x-A[l])
			#B[i,j]:=mul(x-coeff(A,x,l), l=(2^i)*j..(2^i)*(j+1)-1):
			B[i,j]:=mul(x-A[l], l=(2^i)*j+1..(2^i)*(j+1)):
			#print(B[i,j]);
			#print("i=",i,"j=",j);
		od:
	od:
	return B:
end;


#P:=3*x^8+1*x^7+7*x^6-6*x^5+x^3-9*x^2+x+5;
#A:=[1,3,-5,4,0,7,9,-4];

init_arbre2 := proc(A)
	local n, k, i, prod, Left, Right;
	n := nops(A);
	k := log[2](n);
	if n=1 then return [x-A[1]]:
	else
		prod := mul(x-A[i], i=1..n);
		Left := [seq(A[i],i=1..n/2)];
		Right := [seq(A[i],i=(n/2)+1..n)];
		return [prod, init_arbre2(Left),init_arbre2(Right)];
	fi;
end;
